<?php
/**
 * Created by PhpStorm.
 * User: 1
 * Date: 2016-11-15
 * Time: 9:45
 */

namespace app\src\encrypt\algorithm;

use app\src\encrypt\des\Des;
use app\src\encrypt\exception\CryptException;

/**
 * Class Md5V4Alg
 * 目前使用于不加密
 * @author hebidu <email:346551990@qq.com>
 * @package app\src\encrypt\algorithm
 */
class Md5V4Alg extends IAlgorithm
{

    function decryptTransmissionData($transmissionData,$desKey)
    {
        return $transmissionData;
    }

    function encryptTransmissionData($param,$desKey)
    {
        $encrypt_data = json_encode($param);

        return ($encrypt_data);
    }

    function verify_sign($data,$sign)
    {
        return true;
    }

    function sign($param)
    {
        return md5(json_encode($param));
    }

    function decryptData($encryptData)
    {
        return json_decode($encryptData,JSON_OBJECT_AS_ARRAY);
    }

    function encryptData($data)
    {
        $str = json_encode($data,0, 512);
        return $str;
    }

}